

// JSON官网: www.json.org
let s = '{ "id": 1001 , "name": "张三丰" , "age": 108 , "gender": "男" }' ;
console.log( typeof( s ) );

let o = JSON.parse( s );
console.log( typeof( o ) );
console.log( o.id , o.name , o.gender , o.age );

console.log( '- - - - - - - - - - - - - - - - - - - - -' );

let x = Object.create( null );
x.id = 2002 ;
x.name = '郭襄' ;
x.gender = '女' ;
x.age = 16 ;
x.introduce = function(){
    console.log( this.name );
}

console.log( x );

let json = JSON.stringify( x );
console.log( json );

